using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace GameEngine.Units
{
	public class Doodad
	{
		private DoodadType type;

		public Doodad(DoodadType doodadType, World world)
		{
			this.type = doodadType;
			this.World = world;
		}

		internal World World { get; private set; }

		public Vector3 Position { get; set; }
		public float Rotation { get; set; }

		public Model Model
		{
			get
			{
				return this.type.Model;
			}
		}

		internal virtual void Draw(GameTime gameTime, ref Matrix view, ref Matrix projection, BoundingFrustum boundingFrustum)
		{
			Matrix world = Matrix.CreateRotationZ(this.Rotation) * Matrix.CreateTranslation(this.Position);
			Render.DrawBasicEffectModel(gameTime, this.Model, ref view, ref projection, ref world, boundingFrustum);
		}
	}
}
